package com.psy.price.recorder.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;

public class ISBNFileReader {

	private static ISBNFileReader instance = null;

	private List<String> list= new LinkedList<String>();



	private ISBNFileReader(){
		 	File file = new File("isbn.txt");
	        BufferedReader reader = null;
	        try {
	            reader = new BufferedReader(new FileReader(file));
		        } catch (FileNotFoundException e) {
		            e.printStackTrace();
		        }

		        String line;
		        try {
		            while ((line = reader.readLine()) != null) {
		                line = line.trim();
		                list.add(line.trim());
		            }
		        } catch (IOException e) {
		            e.printStackTrace();

		        }

		    }


		   public static synchronized ISBNFileReader getInstance() {
				if (instance == null) {
					instance = new ISBNFileReader();
				}
				return instance;
			}

		   public List<String> getList() {
				return list;
			}


			public void setList(List<String> list) {
				this.list = list;
			}


	}









